﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using JTicket.BLL;

namespace JTicket.UI
{
    public partial class JT_EditeSubArea : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack) {
                Bind();
            }
        }
        public void Bind()
        {
            if (!string.IsNullOrEmpty(Request.QueryString["IDs"].ToString()))
            {
                Model.D_Area model = new BLL.D_Area().GetModel(Request.QueryString["IDs"].ToString());
                this.TextBox2.Text = model.AreaCode;
                this.TextBox1.Text = model.AreaName;
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            Model.D_Area model = new Model.D_Area();
            model.AreaCode = this.TextBox2.Text.Trim();
            model.AreaName = this.TextBox1.Text.Trim();
            BLL.D_Area.Update(model);
            Response.Redirect(Request.QueryString["redirct"].ToString());
        }
    }
}